package com.gexiaobao.pigeon.ui.auction

import android.os.Bundle
import com.gexiaobao.pigeon.app.base.BaseActivity
import com.gexiaobao.pigeon.app.util.StatusBarUtil
import com.gexiaobao.pigeon.databinding.ActivitySuccessfulBidBinding
import com.gexiaobao.pigeon.viewmodel.AuctionViewModel
import me.hgj.jetpackmvvm.ext.util.setOnclickNoRepeat
import me.hgj.jetpackmvvm.util.startActivity

/**
 * @Author      : hxw
 * @Date        : 2024/11/13 10:04
 * @Describe    : 出价成功
 */
class ActivitySuccessfulBid : BaseActivity<AuctionViewModel, ActivitySuccessfulBidBinding>() {

    private var intentType = 0
    private var index = 0

    override fun initView(savedInstanceState: Bundle?) {
        StatusBarUtil.setTransparent(this)
        StatusBarUtil.setLightMode(this)
        intentType = intent.getIntExtra("type",0)
        index = if (intentType == 1){
            0
        }else{
            1
        }
    }

    override fun onBindViewClick() {
        super.onBindViewClick()
        setOnclickNoRepeat(mDatabind.ivSuccessfulBack, mDatabind.tvLookMine, mDatabind.tvContinueBrowsing) {
            when (it) {
                mDatabind.tvContinueBrowsing -> finish()// startActivity<ActivityAuctionDetail>("index" to 0)
                mDatabind.tvLookMine -> {
                    startActivity<ActivityMyPartAuction>("index" to index)
                    finish()
                }

                mDatabind.ivSuccessfulBack -> finish()
            }
        }
    }
}